#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QKeyEvent>
#include <QMainWindow>

#include "node/node.h"
#include "widgets/configCtl.h"
#include "widgets/directionCtl.h"

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow {
    Q_OBJECT

  public:
    MainWindow(std::shared_ptr<AppNode> appNode, QWidget *parent = nullptr);
    ~MainWindow();

    // private slots:
    //   void on_configVal_textEdited(const QString &arg1);

  private:
    // 重写键盘事件处理函数
    void keyPressEvent(QKeyEvent *event) override;
    void keyReleaseEvent(QKeyEvent *event) override;

  private:
    std::shared_ptr<AppNode> appNode_;
    Ui::MainWindow *ui;

    ConfigCtl *configCtl_;
    DirectionCtl *directionCtl_;
};
#endif // MAINWINDOW_H
